home *** CD-ROM | disk | FTP | other *** search
/ Software Explosion / Software Explosion (Fore-Matt Home Computing)(1996).iso / games / workbench / five_in_a_line / source / screen.c < prev    next >
C/C++ Source or Header  |  1994-04-22  |  997b  |  50 lines

  1. #include <intuition/intuition.h>
  2. #include <proto/intuition.h>
  3.  
  4. #include <libraries/gadtools.h>
  5. #include <proto/gadtools.h>
  6.  
  7. #include <stdlib.h>
  8.  
  9. #include "fil.h"
  10.  
  11. extern    APTR            VisualInfo;
  12. extern    struct Screen    *Scr;
  13. extern    UWORD            offx;
  14. extern    UWORD            offy;
  15.         int                gadgetwidth;
  16.         int                gadgetheight;
  17.         int                scoreboxwidth;
  18.         int                scoreboxheight;
  19.  
  20. int setupscreen ( void )
  21. {
  22.     if ( ! ( Scr = LockPubScreen ( "Workbench" ) ) )
  23.         return ( 1L );
  24.     else {
  25.         offx = Scr->WBorLeft;
  26.         offy = Scr->WBorTop + Scr->RastPort.TxHeight + 1;
  27.  
  28.         gadgetwidth = ( Scr->RastPort.TxWidth + 1 ) * 5;
  29.         gadgetheight = Scr->RastPort.TxHeight + 5;
  30.         scoreboxwidth = gadgetwidth * 2;
  31.         scoreboxheight = 3 * gadgetheight + 4 * INTERHEIGHT;
  32.     }
  33.  
  34.     if ( ! ( VisualInfo = GetVisualInfo ( Scr, TAG_DONE ) ) ) return ( 2L );
  35.     else return ( 0L );
  36. }
  37.  
  38. void closedownscreen ( void )
  39. {
  40.     if ( VisualInfo ) {
  41.         FreeVisualInfo ( VisualInfo );
  42.         VisualInfo = NULL;
  43.     }
  44.  
  45.     if ( Scr ) {
  46.         UnlockPubScreen ( NULL, Scr );
  47.         Scr = NULL;
  48.     }
  49. }
  50.